const { VantResolver } = require('@vant/auto-import-resolver');
const ComponentsPlugin = require('unplugin-vue-components/webpack');

module.exports = {
  configureWebpack: {
    plugins: [
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
  },

  // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上，你就需要用这个选项指定这个子路径。例如，如果你的应用被部署在 https://www.ruoyi.vip/admin/，则设置 baseUrl 为 /admin/。
  publicPath: "./",
  // webpack-dev-server 相关配置
  devServer: {
    host: '0.0.0.0',
    port: '8080',
    open: true,
    proxy: {
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      '/': {
        // target: `https://ifood.yunduai.com`,
        // target: `https://zzc.bitzh.edu.cn`,
        // target: `https://food.yunduai.com`,
        target: `http://127.0.0.1:9090`,
        // target: `http://192.168.7.125:8080`,
        changeOrigin: true,
        pathRewrite: {
          '/': '',
        },
      },
    },
    disableHostCheck: true,
  },
};
